<template>
    <div class="son">
    <h1>子组件</h1>
    <button @click="emits('customEvent','啊啊啊')">触发回调</button>
</div>
</template>

<script lang="ts">
export default {
name:'Son'
}
</script>

<script setup lang="ts">
//引入
import { defineProps, ref } from 'vue';
import { storeToRefs } from 'pinia';

//获取父组件传来的参数
const emits = defineEmits(['customEvent'])



</script>

<style lang="css">
.son{
    margin: 20px;
    width: 400px;
    height: 100px;
    background-color:antiquewhite;
}
</style>